export function parseMultiJson (jsonStr) {
    const jsonArr = []
    let startIndex = 0
    let endIndex = 0

    while (startIndex < jsonStr.length) {
        // 找到一个JSON对象的开始位置
        startIndex = jsonStr.indexOf('{', startIndex)
        if (startIndex === -1) {
            break
        }

        // 找到一个 JSON 对象的结束位置
        let openBrackets = 1
        endIndex = startIndex + 1
        let quoteTag = 0
        let currChar = ''
        while (openBrackets > 0 && endIndex < jsonStr.length) {
            currChar = jsonStr[endIndex]
            if (currChar === '"') {
                if (quoteTag == 0) {
                    quoteTag = 1
                } else {
                    quoteTag = 0
                }
            }
            if (currChar === '{' && quoteTag == 0) {
                openBrackets ++
            } else if (currChar === '}' && quoteTag == 0) {
                openBrackets --
            }
            endIndex++
        }

        // 将该 JSON 对象解析为一个对象，并添加到数组中
        const json = jsonStr.substring(startIndex, endIndex)
        // console.log('json字符串....', json)
        jsonArr.push(JSON.parse(json))

        // 更新下一个 JSON 对象的开始位置
        startIndex = endIndex
    }
    return jsonArr
}
